<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>Halaman Utama Culture-vid</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
	<link href="<?php echo base_url()?>asset/css/bootstrap.css" rel="stylesheet">
    <link rel="shortcut icon" href="/favicon.ico">
	<link href="<?php echo base_url()?>asset/css/style.css" rel="stylesheet">
	<style>
	@media (min-width: 768px) {
		.buka {
			 visibility: hidden;
		}
	}
	
	
	@media only screen and (max-width: 599px) {
		.vjs-default-skin .vjs-big-play-button {
			left: 25%; top: 25%; wdth:50%; height:50%;
		}
	}
	
	@media only screen and (min-width: 600px) and (max-width:760px) {
		.vjs-default-skin .vjs-big-play-button {
			left: 25%; top: 25%; wdth:50%; height:50%;
			font-size:5em;
		}
	}
	
	video-js{
		padding-top: 56.25%;
	}
	
	vjd-fullscreen {
		padding-top: 0px;
	}
	
	.videoWrapper{
	
	}
	
	</style>

		
	<style type="text/css">
	 
	#share-buttons img {
	width: 35px;
	padding: 5px;
	border: 0;
	box-shadow: 0;
	display: inline;
	}
	 
	</style>
	
	<link href="<?php echo base_url();?>player/video-js.min.css" rel="stylesheet" type="text/css">
	  <!-- video.js must be in the <head> for older IEs to work. -->
	  <script src="<?php echo base_url();?>player/video.js"></script>

	  <!-- Unless using the CDN hosted version, update the URL to the Flash SWF -->
	  <script>
		videojs.options.flash.swf = "<?php echo base_url();?>player/video-js.swf";
	  </script>

</head>
<body>  
	<div class="container-fluid" style="background-color:">  
		    <div class="row-fluid">  
				<div class="col-lg-12" id="header">  
					<a href="<?php echo base_url()?>index.php"><img src="<?php echo base_url()?>asset/img/logo.png" style="width: 300px; height: 120px; align:center; display: inline; margin: 0px 0 50px 20px"/></img></a>
					<h3 style="margin: -79px 0 20px 90px; font-family: Georgia; font-size: 30px"></h3> <br>
					<small style="font-family: Times New Roman; font-size: 17px; margin: -40px 0 0 90px; display: inline; position: absolute"></small>
					<span style="margin-top: -15px; margin-right:10px; font-family: tahoma; font-size:18px;" class="pull-right span3">
					
					<?php
					
				if(!$this->session->userdata('isLogin')) { ?>
					<button class="btn btn-primary" data-toggle="modal" data-target="#modal_login"><span class="glyphicon glyphicon-log-in"></span> Masuk</button>
				| <a href="<?php echo base_url()?>index.php/akun/daftar" class="btn btn-success" role="button"><span class="glyphicon glyphicon-list-alt"></span> Daftar</a>
					<?php } else { if($this->session->userdata('peran') == 0) { ?> <a href="<?php echo base_url()?>index.php/admin" class="btn btn-primary" role="button">Administrator</a> | <?php } ?> <a href="<?php echo base_url()?>index.php/akun/keluar_akun" class="btn btn-danger" role="button"><span class="glyphicon glyphicon-log-out"></span> Keluar</a> <?php } ?>
					</span>
					
				</div>  
			</div> 
		<div class="row-fluid" >
			<div class="col-lg-12" id="navbar" >
				<form class="navbar-form navbar-right" style="margin-top:10px; margin-right:0px; margin-left:1px;" role="search" action="<?php echo base_url()?>index.php/video/cari_video" method="post">
				
					  <div class="form-group ">
						<input type="text" class="form-control" placeholder="cari video disini..." name="cari">
					  </div>
					  <button type="submit" class="btn btn-danger " ><span class="glyphicon glyphicon-search "></span></button>
				</form>
			</div> 
		</div>
		
	<div class="container-fluid">  
		<div class="row-fluid">  
			<div class="col-lg-2 " style="" id="left-content">   
				 <div class="row-fluid">  
					<?php $user = $this->session->userdata('username'); ?>
					<?php if($user != NULL):?>
					<?php if($this->session->userdata('peran')!= 0) {?>
					   <div class="col-lg-12" id="sidebar-widget">
							<ul class="nav nav-list">
							  <li class="nav-header" style=""><?php echo $user; ?></li>
								<li><a href="<?php if($this->session->userdata('peran') != 1 ) {
								echo base_url();?>index.php/profil" <?php } else { echo base_url();?>index.php/admin" <?php } ?>class="glyphicon glyphicon-user">  Profilku</a></li>
								<?php if($this->session->userdata('peran') != 1 ){ ?>
								<?php if($this->session->userdata('status') == 1) { ?>
									<li><a href="<?php echo base_url()?>index.php/video/" class="glyphicon glyphicon-upload">  Unggah</a></li> 
									<li><a href="<?php echo base_url()?>index.php/video/videoku" class="glyphicon glyphicon-film"  data-toggle="collapse" data-target=".hisCollapse" style="">  Videoku</a></li>
									<?php } else { ?>
										<li class="disabled"><a class="glyphicon glyphicon-upload">  Unggah</a></li> 
										<li class="disabled"><a class="glyphicon glyphicon-film">  Videoku</a></li> 
									<?php } ?>
								<?php } ?>
							</ul>
							<br>
						</div> 
						<?php } ?>
						<?php endif;?>
						
					<div class="col-lg-12" id="sidebar-widget" style="margin-top:20px;"> 
						<ul class="nav nav-list">
						  <li class="nav-header" data-toggle="collapse" data-target=".navCollapse" style="">Kategori <span class="glyphicon glyphicon-align-justify pull-right"></span></li>
						   <ul class="nav nav-list collapse in navCollapse">
								<?php foreach($kategori as $row) {?>
									<li><a href="<?php echo base_url();?>index.php/video/cari_video_sesuai_kategori/<?php echo $row->id_kategori;?>"><?php echo $row->nama_kategori;?></a></li>  
								<?php } ?>
							</ul>
						</ul>
					</div>    
					
					<?php if(count($histori_video) > 0 ) {?>
					<div class="col-lg-12" id="sidebar-widget" style="margin-top:20px;"> 
					<ul class="nav nav-list">
					  <li class="nav-header" data-toggle="collapse" data-target=".hisCollapse" style="">Histori Video<span class="glyphicon glyphicon-align-justify pull-right"></span></li>
					   <ul class="nav nav-list collapse in hisCollapse">
							<?php foreach($histori_video as $row) {?>
								<li><a href="<?php echo base_url();?>index.php/video/lihat_video/<?php echo $row->id_video;?>"><?php echo $row->judul_video;?></a></li>  
							<?php } ?>
						</ul>
						</ul>
					</div>
					<?php } ?>
				  
				 </div>  
			 
			</div>  
			<br>
			   	   
		<div class="col-lg-8">  
			<div class="container-fluid">
					<!-- konten video -->
					  <div class="col-lg-12 " style="margin-left:0px"> 
					   <legend style="margin-top:0px"><h3><?php echo $judul_video;?> <small><?php echo $tgl_upload;?></small></h3></legend>  
						
						<div class="col-lg-12" style="margin-bottom:10px;"> 
						
						<div class="videocontent">
						<!-- player video --><center>
						<?php if($file_ext == '.mp4') { ?>
							<video id="example_video_1" class="video-js vjs-default-skin vjs-big-play-centered" height="350px" width="75%" style="" controls preload="none" poster="<?php echo base_url()?>upload/image/<?php echo $gambar_video;?>" data-setup="{}">
								
								<source src="<?php echo base_url()?>upload/video/<?php echo $nama_video;?>" type="video/mp4">
								
							</video>
						<?php } else if($file_ext == '.flv') { ?>
							<script src="<?php echo base_url()?>player/mpw-player/includes/swfobject.js" type="text/javascript"></script>
							<div id="flvplayer" style="height:350px; width:100%; " ></div>
								<script type="text/javascript">
									var so = new SWFObject("<?php echo base_url()?>player/mpw-player/mpw_player.swf", "swfplayer", "500", "100%", "0", "#000000");
									so.addVariable("flv", "<?php echo base_url()?>upload/video/<?php echo $nama_video;?>");
									so.addVariable("jpg","<?php echo base_url()?>upload/image/<?php echo $gambar_video;?>");
									//so.addVariable("autoplay","true");
									so.addParam("allowFullScreen","true");
									so.write("flvplayer");
								</script>
						<?php } ?>
							
						<!-- player video end --></center>	
						
						</div>
						</div>
						
						<legend style="margin-top:10px;"><h4>Deskripsi Video</h4></legend>  
						<div class="col-lg-12 " style="margin-top:0px"> 
						<!-- deskripsi video -->
							<div class="col-lg-10"><?php echo $deskripsi_video;?></div>
							
							<?php $peran = $this->session->userdata('peran'); if($peran == 2) { ?><a href="<?php echo base_url()?>index.php/video/validasi/<?php echo $id_video;?>"><span class="col-lg-2 btn btn-success pull-right">Validasi Video</span></a>
							<?php } ?>
						</div>
						
						<div class="col-lg-12" style="margin-top:10px">
							<b>Kontributor</b> &nbsp  &nbsp  &nbsp  &nbsp  : &nbsp <?php echo $nama_user; ?>
						</div>
							
						<div class="col-lg-12 " style="margin-top:5px"> 
						
							<b>Kategori video</b> &nbsp :  &nbsp <?php $i = 1; foreach($nama_kategori as $hasil) { if(count($nama_kategori) == $i) { ?> <a href="<?php echo base_url();?>index.php/video/cari_video_sesuai_kategori/<?php echo $hasil->id_kategori;?>"><?php echo $hasil->nama_kategori.'. ';?></a><?php } else { ?> <a href="<?php echo base_url()?>index.php/video/cari_video_sesuai_kategori/<?php echo $hasil->id_kategori;?>"><?php echo $hasil->nama_kategori.', ';}?></a> <?php $i++;}?>
						</div>
						
						<div class="col-lg-12 bg-danger" style="margin-top:0px"> 
							<div id="share-buttons" class="pull-right">
						<!-- Facebook -->
							<a href="http://www.facebook.com/sharer.php?u=<?php echo current_url();?>" target="_blank"><img src="<?php echo base_url();?>/asset/img/facebook.png" alt="Facebook" /></a>
							 
							<!-- Twitter -->
							<a href="http://twitter.com/share?url=<?php echo current_url();?>&text=<?php echo $judul_video;?>" target="_blank"><img src="<?php echo base_url();?>/asset/img/twitter.png" alt="Twitter" /></a>
							 
							<!-- Google+ -->
							<a href="https://plus.google.com/share?url=<?php echo current_url();?>" target="_blank"><img src="<?php echo base_url();?>/asset/img/google.png" alt="Google" /></a>
							 
							<!-- Digg 
							<a href="http://www.digg.com/submit?url=<?php echo current_url();?>" target="_blank"><img src="<?php echo base_url();?>/asset/img/diggit.png" alt="Digg" /></a>-->
							 
							<!-- Reddit 
							<a href="http://reddit.com/submit?url=<?php echo current_url();?>&title=<?php echo $judul_video;?>" target="_blank"><img src="<?php echo base_url();?>/asset/img/reddit.png" alt="Reddit" /></a>-->
							 
							<!-- LinkedIn -->
							<a href="http://www.linkedin.com/shareArticle?mini=true&url=<?php echo current_url();?>" target="_blank"><img src="<?php echo base_url();?>/asset/img/linkedin.png" alt="LinkedIn" /></a>
							 
							<!-- Pinterest -->
							<a href="javascript:void((function()%7Bvar%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','http://assets.pinterest.com/js/pinmarklet.js?r='+Math.random()*99999999);document.body.appendChild(e)%7D)());"><img src="<?php echo base_url();?>/asset/img/pinterest.png" alt="Pinterest" /></a>
							 
							<!-- StumbleUpon-->
							<a href="http://www.stumbleupon.com/submit?url=<?php echo current_url();?>&title=<?php echo $judul_video;?>" target="_blank"><img src="<?php echo base_url();?>/asset/img/stumbleupon.png" alt="StumbleUpon" /></a>
							 
							<!-- Email 
							<a href="mailto:?Subject=Simple Share Buttons&Body=I%20saw%20this%20and%20thought%20of%20you!%20 http://www.simplesharebuttons.com"><img src="<?php echo base_url();?>/asset/img/email.png" alt="Email" /></a>-->
						 
							</div>
						</div>
						
						<br><br>
						
						<div class="col-lg-12" style="margin-top:0px"> <h4>Komentar  <?php if($user == null){?><small>Silahkan <a href="" data-toggle="modal" data-target="#modal_login">masuk</a> dahulu untuk memberikan komentar</small><?php } ?></h4><blink><?php echo $berhasil; ?></blink></div>
						<?php if($user != NULL && $this->session->userdata('isLogin') && $this->session->userdata('peran') != 1 && $this->session->userdata('peran') != 2) { ?>
						<div class="col-lg-12 bg-info" style="margin-top:10px"> 
							<legend></legend>
							<form class="form-horizontal" role="form" action="<?php echo base_url()?>index.php/komentar/tambah_komentar" method="post">
							
								<div class="col-sm-2">
								  <a class="thumbnail" ><img style="height:50px; width:100%;" src="<?php echo base_url();?>upload/image/user/<?php echo $foto_komentator;?>" alt=""></a>
								</div>
								<div class="form-group col-sm-8">
									  <input type="text" name="isi_komentar" class="form-control " id="isi_komentar" placeholder="Masukkan komentar Anda">
								</div>
								<input type="text" name="id_video" value="<?php echo $id_video?>" class="form-control hidden " >
									<div class="col-sm-2">
									  <button type="submit" class="btn btn-success">Post</button>
									</div>
								
							</form>
						</div>
						<?php } ?>
						
						<?php foreach($listkomentar as $row){ ?>
						<div class="col-lg-12" style="margin-top:15px">
							
							<div class="col-lg-2 col-lg-6">
							<a class="thumbnail"><img style="height:50px; width:100%;" src="<?php echo base_url();?>upload/image/user/<?php echo $row->nama_foto; ?>" alt=""></a>
							</div>
							
							<div class="col-lg-6">
								<p>
									<u><h5><b><?php echo $row->nama_lengkap; ?>  </b><small class="pull-right"><?php echo $row->waktu_komentar; ?></small></h5></u>
										<?php if($row->id_user == $this->session->userdata('id_user')) { ?><a href="<?php echo base_url()?>index.php/komentar/delete_komentar_pribadi/<?php echo $row->id_komentar;?>/<?php echo $row->id_video;?>" onclick="return confirmDel()" class="close" >&times;
										</a> <?php } ?>
								</p>
								<p><h4><small style="color:black"><?php echo $row->isi_komentar;?></small><h4></p>
							</div>
							<legend></legend>
							<script type="text/javascript">
							function confirmDel(){
							return confirm("Apakah Anda yakin untuk menghapus komentar ini?");
							}
						</script>
						</div>
						<?php } ?>
					  </div>  
					  <!-- end -->
					
				  
			 </div>
		</div>
		
			<div class="col-lg-2"  style="margin-top:10px;">
				<ul class="nav nav-list">
					<li class="nav-header" data-toggle="collapse" data-target=".navHeaderCollapse" style="">Asal Daerah <span class="glyphicon glyphicon-align-justify pull-right"></span></li>
					   <ul class="nav nav-list collapse navHeaderCollapse">
							<?php foreach($daerah as $row) {?>
								<li><a href="<?php echo base_url();?>index.php/video/cari_video_sesuai_kategori/<?php echo $row->id_kategori;?>"><?php echo $row->nama_kategori;?></a></li>  
							<?php } ?>  
						</ul>
				</ul>
			</div>
		
		
		
		
	   </div>  
	  
	  
	  
	  
	   <!--S : Footer-->  
	  
	   <div class="row-fluid">  
		<div class="col-lg-12" id="footer"> <p class = "footer-text"> Copyright 2014 </p> 
		</div>  
	   </div>  
	  
	   <!--E : Footer-->  
	  </div>
	</div>
							
				<!-- modal start login akun-->
			<div class="modal fade " style="overflow:hidden;" id="modal_login" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			  <div class="modal-dialog" >
				<div class="modal-content">
				  <div class="modal-header" style="background-color:#3399FF;">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					<b><h4 class="modal-title" id="myModalLabel" style="color:#ffffff;">Masuk <i>Culture-Vid</i></h4></b>
				  </div>
				  <div class="modal-body" >
				  
					<form class="form-horizontal" role="form" action="<?php echo base_url()?>index.php/akun/login" method="post">
					  <div class="form-group">
						<div class="col-sm-8">
						  <input type="text" name="hidden" class="form-control hidden" id="hidden" value="utama">
						</div>
					  </div>
					  <div class="form-group">
						<label for="namaakun" class="col-md-3 control-label">Nama Akun</label>
						<div class="col-sm-8">
						  <input type="text" name="username" class="form-control " id="namaakun" placeholder="Nama Akun Anda" required>
						</div>
					  </div>
					  <div class="form-group">
						<label for="inputPassword3" class="col-md-3 control-label">Kata Kunci</label>
						<div class="col-sm-8">
						  <input type="password" class="form-control" id="katakunci" name="password" placeholder="Kata Kunci" required>
						</div>
					  </div> 
					  <div class="form-group">
						<div class="col-sm-offset-2 col-sm-10">
						  <div class="checkbox">
							<label  style="margin-right:50px;">
							  <input type="checkbox"> Ingat Akun
							</label>
							<span class="glyphicon glyphicon-question-sign"></span>
							<a href="<?php echo base_url()?>/akun/lupa_pass">Lupa Kata Kunci Anda</a>
						  </div>
						</div>
					  </div>
					  <div class="form-group">
						<div class="col-sm-offset-2 col-sm-10">
						  <button type="submit" class="btn btn-success">Masuk</button>
						  <button type="button" class="btn btn-default" data-dismiss="modal">Batal</button>
						</div>
					  </div>
					</form>
				  </div>
				</div><!-- /.modal-content -->
			  </div><!-- /.modal-dialog -->
			</div><!-- /.modal -->
		
			<!-- modal end login akun-->
	
											<!-- modal start daftar akun-->
				
		<!-- Button trigger modal -->

			<!-- Modal -->
			<div class="modal fade" style="" id="modal_daftar" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			  <div class="modal-dialog" >
				<div class="modal-content">
				  <div class="modal-header" style="background-color:#E34D55;">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel" style="color:#ffffff;">Daftar Akun <i>Culture-Vid</i></h4>
				  </div>
				  <div class="modal-body" >
				  <div id="registerModalerror"></div>
					<form class="form-horizontal" role="form" action="<?php echo base_url()?>index.php/akun/daftar_akun" method="post">
					  <div class="form-group">
						<label for="inputakun" class="col-md-4 control-label">Nama Akun</label>
						<div class="col-sm-8">
						  <input type="text" name="namaakun" class="form-control" id="namaakun" placeholder="Nama Akun" required>
						</div>
					  </div>
					  <div class="form-group">
						<label for="inputkatakunci" class="col-md-4 control-label">Kata Kunci</label>
						<div class="col-sm-8">
						  <input type="password" class="form-control" id="katakunci" name="katakunci" placeholder="Kata Kunci" required>
						</div>
					  </div>
					  <div class="form-group">
						<label for="konfirmasikatakunci" class="col-md-4 control-label">Konfirmasi Kata Kunci</label>
						<div class="col-sm-8">
						  <input type="password" class="form-control" id="konfirmasikatakunci" name="konfirmasikatakunci" placeholder="Konfirmasi Kata Kunci">
						</div>
					  </div>
					  <div class="form-group">
					  <label for="jk" class="col-md-4 control-label">Jenis Kelamin</label>
							<div class="col-sm-8">
							  <div class="radio">
								  <label>
									<input type="radio" name="jk" id="lakilaki" value="1" checked>
									Laki - laki
								  </label>
								</div>
								<div class="radio">
								  <label>
									<input type="radio" name="jk" id="perempuan" value="2">
									Perempuan
								  </label>
							</div>
							</div>
					  </div>
					  
					  <div class="form-group">
						<label for="tanggallahir" class="col-md-4 control-label">Tanggal Lahir</label>
						<div class="col-sm-8">
						  <input type="text" id="datepicker" class="form-control" name="tanggallahir">
						</div>
					  </div>
					  
					  <div class="form-group">
						<label for="email" class="col-md-4 control-label">Alamat Email</label>
						<div class="col-sm-8">
						  <input type="email" id="email" class="form-control" name="email" required>
						</div>
					  </div>
					  
					   <div class="form-group">
						<label for="peran" class="col-md-4 control-label">Daftar Sebagai</label>
					  <div class="btn-group col-sm-5">
						  <select class="form-control" name="peran">
							<option value="1">Reviewer</option>
							<option value="2">Kontributor</option>
						  </select>
						</div>
					  </div>
					  
					  <div class="form-group">
						<label for="pendidikan" class="col-md-4 control-label">Pendidikan</label>
					  <div class="btn-group col-sm-5">
						  <select class="form-control" name="pendidikan">
							<option>SMP</option>
							<option>SMA</option>
							<option>S1</option>
							<option>S2</option>
							<option>S3</option>
						  </select>
						</div>
					  </div>
					  
					  <div class="form-group">
						<label for="pekerjaan" class="col-md-4 control-label">Pekerjaan</label>
					  <div class="btn-group col-sm-5">
						  <select class="form-control" name="pekerjaan">
							<option>Guru</option>
							<option>Wiraswasta</option>
							<option>Pelajar</option>
							<option>PNS</option>
							<option>Dosen</option>
						  </select>
						</div>
					  </div>
					  <div class="form-group">
						<div class="col-sm-offset-2 col-sm-10">
						  <button type="submit" class="btn btn-success">Daftar</button>
						  <button type="button" class="btn btn-default" data-dismiss="modal">Batal</button>
						</div>
					  </div>
					</form>
				  </div>
				</div><!-- /.modal-content -->
			  </div><!-- /.modal-dialog -->
			</div><!-- /.modal -->
			<!-- modal end daftar akun-->
    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
	<script src="<?php echo base_url()?>asset/js/jquery.js"></script>
    <script src="<?php echo base_url()?>asset/js/bootstrap.js"></script>
	
</body>
</html>